package com.igeek.car.service.impl;

import com.igeek.car.service.OssService;
import com.igeek.car.utils.AliOssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class OssServiceImpl implements OssService {
    @Autowired
    private AliOssUtils aliOssUtils;

    @Override
    public String uploadFile(MultipartFile file) {
        try {
            return aliOssUtils.upload(file);
        } catch (Exception e) {
            throw new RuntimeException("文件上传失败", e);
        }
    }
}
